<script setup>
import ProjectShowcase from './components/ProjectShowcase.vue'
</script>

<template>
  <div class="app-container">
    <!-- 添加社交媒体图标 -->
    <div class="social-icons">
      <a href="https://github.com/bing-1357/" target="_blank" class="social-icon">
        <i class="fab fa-github"></i>
      </a>
      <a href="#" class="social-icon" @mouseenter="showQR('wechat')" @mouseleave="hideQR('wechat')">
        <i class="fab fa-weixin"></i>
        <!-- 微信二维码弹窗 -->
        <div class="qr-popup" v-if="qrCodes.wechat">
          <img src="./assets/image/wechat-qr.png" alt="WeChat QR Code">
        </div>
      </a>
      <a href="#" class="social-icon" @mouseenter="showQR('douyin')" @mouseleave="hideQR('douyin')">
        <i class="fab fa-tiktok"></i>
        <!-- 抖音二维码弹窗 -->
        <div class="qr-popup" v-if="qrCodes.douyin">
          <img src="./assets/image/douyin-qr.png" alt="Douyin QR Code">
        </div>
      </a>
    </div>

    <header class="header">
      <h1 class="title">我的作品集</h1>
      <p class="subtitle">这里展示了我的一些Web开发项目</p>
    </header>

    <!-- 添加路由视图 -->
    <router-view v-slot="{ Component }">
      <component :is="Component" />
    </router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      qrCodes: {
        wechat: false,
        douyin: false
      }
    }
  },
  methods: {
    showQR(type) {
      this.qrCodes[type] = true;
    },
    hideQR(type) {
      this.qrCodes[type] = false;
    }
  }
}
</script>

<style>
/* 添加全局样式 */
body {
  margin: 0;
  padding: 0;
}

#app {
  min-height: 100vh;
}
</style>

<style scoped>
.app-container {
  min-height: 100vh;
  background-image: url('./assets/image/cool-background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative; /* 添加这行 */
}

/* 添加社交媒体图标样式 */
.social-icons {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 20px;
  z-index: 1000;
}

.social-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #333;
  font-size: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  position: relative;
}

.social-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

/* 微信二维码弹窗样式 */
.qr-popup {
  position: absolute;
  top: 50px;
  right: 0;
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.qr-popup img {
  width: 150px;
  height: 150px;
  display: block;
}

/* 添加动画效果 */
.qr-popup {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* GitHub图标特殊样式 */
.fa-github:hover {
  color: #24292e;
}

/* 微信图标特殊样式 */
.fa-weixin:hover {
  color: #07c160;
}

/* 抖音图标特殊样式 */
.fa-tiktok:hover {
  color: #000000;
}

.header {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
}

.title {
  font-size: 32px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
}

.subtitle {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* 添加响应式样式 */
@media (max-width: 768px) {
  .social-icons {
    top: 10px;
    right: 10px;
    gap: 15px;
  }

  .social-icon {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}
</style> 